package com.guifan.controller.exception;

import com.guifan.inter.StatusCode;
import lombok.Getter;

/**
 * @author God.Jhon.Black
 * @date 2023-01-17
 */
@Getter
public class APIException extends RuntimeException {
    private int code;
    private String msg;


    public APIException(StatusCode statusCode, String message) {
        super(message);
        this.code = statusCode.getCode();
        this.msg = statusCode.getMsg();
    }

    public APIException(String message) {
        super(message);
        this.code = AppCode.APP_ERROR.getCode();
        this.msg = AppCode.APP_ERROR.getMsg();
    }

}
